package io.renren.modules.school.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.school.dao.ProfessionDao;
import io.renren.modules.school.dao.ProfessionLowScoreDao;
import io.renren.modules.school.entity.PrefessionLowScoreEntity;
import io.renren.modules.school.entity.ProfessionEntity;
import io.renren.modules.school.service.ProfessionLowScoreService;
import io.renren.modules.school.service.ProfessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("ProfessionLowScoreService")
public class ProfessionLowScoreServiceImpl extends ServiceImpl<ProfessionLowScoreDao, PrefessionLowScoreEntity> implements ProfessionLowScoreService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String schoolId = (String)params.get("schoolId");
        String professionId = (String)params.get("professionId");
        Page<PrefessionLowScoreEntity> page = this.selectPage(
                new Query<PrefessionLowScoreEntity>(params).getPage(),
                new EntityWrapper<PrefessionLowScoreEntity>()
                        .eq("school_id",schoolId)
                        .eq("profession_id",professionId)
        );

        return new PageUtils(page);
    }

}
